home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / misc / emu / Apex-src.lha / TUTORIAL.DOC < prev    next >
Text File  |  2001-09-30  |  25KB  |  809 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.             APEX ON THE AMIGA
  15.  
  16.             A TUTORIAL OVERVIEW
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.                 SEP-22-87
  53.  
  54.                 CONTENTS
  55.  
  56.  
  57.         INTRODUCTION  .  .  .  .  .  .  .  .  .  .  .  1
  58.  
  59.         BOOTUP  .  .  .  .  .  .  .  .  .  .  .  .  .  1
  60.  
  61.         THE DIRECTORY .  .  .  .  .  .  .  .  .  .  .  2
  62.  
  63.         THE TITLE  .  .  .  .  .  .  .  .  .  .  .  .  2
  64.  
  65.         THE DATE   .  .  .  .  .  .  .  .  .  .  .  .  2
  66.  
  67.         RUNNING PROGRAMS UNDER APEX  .  .  .  .  .  .  3
  68.  
  69.         THE TEXT EDITOR  .  .  .  .  .  .  .  .  .  .  3
  70.  
  71.         MOVING THE CURSOR   .  .  .  .  .  .  .  .  .  4
  72.  
  73.         COMMAND-LINE COMMANDS  .  .  .  .  .  .  .  .  4
  74.  
  75.         EXITING FROM THE EDITOR   .  .  .  .  .  .  .  6
  76.  
  77.         DEFAULT FILES .  .  .  .  .  .  .  .  .  .  .  6
  78.  
  79.         AN XPL0 PROGRAM  .  .  .  .  .  .  .  .  .  .  7
  80.  
  81.         COMPILING AND EXECUTING AN XPL0 PROGRAM  .  .  7
  82.  
  83.         RUNNING AN ASSEMBLY LANGUAGE PROGRAM  .  .  .  8
  84.  
  85.         A MORE ELABORATE XPL0 PROGRAM   .  .  .  .  . 10
  86.  
  87.         TYPES OF APEX FILES .  .  .  .  .  .  .  .  . 11
  88.  
  89.         INSTALLING A PRINTER HANDLER .  .  .  .  .  . 12
  90.  
  91.         BACKUP FILES  .  .  .  .  .  .  .  .  .  .  . 13
  92.  
  93.         SQUASH  .  .  .  .  .  .  .  .  .  .  .  .  . 13
  94.  
  95.         DELETE  .  .  .  .  .  .  .  .  .  .  .  .  . 14
  96.  
  97.         COPY .  .  .  .  .  .  .  .  .  .  .  .  .  . 14
  98.  
  99.         HELP .  .  .  .  .  .  .  .  .  .  .  .  .  . 14
  100.  
  101.  
  102.  
  103. INTRODUCTION
  104.  
  105. Apex is designed to help programmers create and test programs. This
  106. tutorial describes how to use it to write programs in both XPL0 and
  107. assembly language. But Apex is not just limited to programming, it is
  108. useful for creating any kind of text -- like this tutorial for example.
  109.  
  110. Apex is a disk operating system. It is an alternative to Amiga DOS. An
  111. operating system is the highest level program in your computer. It is
  112. used to run other programs and to manage various kinds of files.
  113.  
  114. This tutorial is intended to get you started. It presents enough infor-
  115. mation about a few commands so that you can experiment with the re-
  116. maining commands as you learn them. It makes no attempt to fully explain
  117. all the intricacies of the commands presented, nor to cover all of the
  118. commands in Apex.
  119.  
  120. To run version 1.8 Apex, you must have an Amiga A1000 with 512K of RAM.
  121. Currently, it will not run on the A500 or A2000. Also, it is assumed
  122. that you have either an Epson or C.Itoh printer (or compatible) con-
  123. nected to the parallel port.
  124.  
  125.  
  126. BOOTUP
  127.  
  128. The Apex System disk boots in place of the Amiga Kickstart disk. Insert
  129. the Apex System disk into the internal drive and boot it in the normal
  130. manner -- by either turning on power, or by simultaneously pressing both
  131. Amiga (A) keys and the <CTRL> key. You should see something like this:
  132.  
  133.  
  134.           A P E X
  135.          / \
  136.         /   \
  137.  
  138.          BY
  139.  
  140.     COMPUTER APPLICATIONS
  141.     4334 EAST 17TH AVENUE
  142.     DENVER COLORADO 80220
  143.  
  144.     TYPE "HELP" FOR INSTRUCTIONS
  145.  
  146.     -- APEX V1.8x17 --
  147.     DATE FROM SYSTEM UNIT: TUE, SEP-15-87
  148.     RELOADED FROM UNIT 0
  149.  
  150.     APX>
  151.  
  152.  
  153.  
  154. THE DIRECTORY
  155.  
  156. After the Apex prompt, type:
  157.  
  158.     APX>DIR 0<RETURN>
  159.  
  160. The <RETURN> notation means press the RETURN key. Also, "APX>" is shown
  161. for orientation. It should not be typed in.
  162.  
  163. You should see the directory of the disk, which shows the current date,
  164. the volume number, the unit number, the title, and a list of all the
  165. files on the disk. If the directory is longer than one screen, then
  166. press any key to see the rest of it.
  167.  
  168. To see the long form of the directory, type:
  169.  
  170.     APX>DIR 0/L<RETURN>
  171.  
  172. This shows additional information about the files. It shows the length
  173. of the files in blocks, their creation date, and their location on the
  174. disk.
  175.  
  176. Apex divides units into blocks. Each block contains 256 bytes, or char-
  177. acters, of information. The 3-1/2 inch Amiga disk can hold 3520 blocks.
  178.  
  179. There is also a backup directory, which can be used in the event the
  180. main directory is damaged. To display the backup directory, enter the
  181. command:
  182.  
  183.     APX>BDIR 0<RETURN>
  184.  
  185.  
  186.  
  187. THE TITLE
  188.  
  189. You can change the title of your disk by using the TITLE command. For
  190. example, type:
  191.  
  192.     APX>TITLE 1:WORK SPACE<RETURN>
  193.  
  194. Now use the directory command to verify that the title has changed:
  195.  
  196.     APX>DIR 1<RETURN>
  197.  
  198. Using the correct title will help you organize your work.
  199.  
  200.  
  201. THE DATE
  202.  
  203. Set the current date by typing:
  204.  
  205.     APX>DATE<RETURN>
  206.  
  207. Apex replies:
  208.  
  209.     NEW DATE (MM-DD-YY)?
  210.  
  211. Enter the date in the form month-day-year, for example: 9-20-87. Apex
  212. echoes this new date, and to verify it, displays the day of the week.
  213.  
  214. The current date is used as the creation date of any files that you
  215. make. It is very helpful for determining the latest version of a file.
  216. You should set the date whenever you bootup for the first time each
  217. day.
  218.  
  219.  
  220. RUNNING PROGRAMS UNDER APEX
  221.  
  222. To run a program under Apex, you simply type its name (you don't type
  223. "RUN"). This makes running a program look the same as executing an Apex
  224. command. In fact some programs are so closly associated with Apex that
  225. it is difficult to tell that they are not commands. These programs are
  226. considered part of the Apex system and are called utilities.
  227.  
  228. DIR, TITLE, and DATE are commands, but as we will see in a moment, ED is
  229. a utility.
  230.  
  231.  
  232. THE TEXT EDITOR
  233.  
  234. The text editor is a program that enables you to easily write and modify
  235. any kind of text. When programs become large or lines become intricate,
  236. it is important to be able to locate, modify, and insert code. The
  237. editor allows you to do this. It permits you, for example, to search for
  238. misspelled words, delete them, and insert the corrections.
  239.  
  240. Before you can use the editor, you need to create a file using the MAKE
  241. command. Type:
  242.  
  243.     APX>MAKE 1:AFILE.TXT<RETURN>
  244.  
  245. Now start the editor by typing:
  246.  
  247.     APX>ED 1:AFILE.TXT<RETURN>
  248.  
  249. You should see a display that looks like this:
  250.  
  251.  
  252.  
  253.  
  254.  
  255. #
  256.  
  257. 
  258. #---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
  259.    -- ED, Version 1.0x15 --                  For help type <ESC>?<ESC><ESC>
  260. eof       CMD: 0   SCOOP: 5000   S # s -->   REM: 80000   AT: 0       COL:0
  261. 
  262. To enter text, you just start typing. Type:
  263.  
  264.     This is my first line using ED.<RETURN>
  265.     This is my second line.<RETURN>
  266.  
  267.  
  268.  
  269. MOVING THE CURSOR
  270.  
  271. The ED editor has a number of commands that are performed by typing
  272. control characters. Control characters are typed by using the <CTRL> key
  273. like the <SHIFT> key, that is, by holding the <CTRL> key down while
  274. typing the character.
  275.  
  276. After you have typed the lines above, the cursor will be at the end.
  277. Move it to the beginning by typing CTRL-E. Now change the word "first"
  278. to "changed" by moving the cursor forward by repeatedly typing CTRL-A
  279. until it is at the end of the word "first". Now use the back-arrow key
  280. to delete "first". Finally, type the word "changed".
  281.  
  282. The commands you need most often are the ones that move the cursor.
  283. They are:
  284.  
  285.     CTRL-A        Move ahead one character
  286.     CTRL-S        Move ahead one line
  287.     CTRL-D        Move to the end of text
  288.  
  289.     CTRL-Q        Move back one character.
  290.     CTRL-W        Move back one line
  291.     CTRL-E        Move to the beginning of text
  292.  
  293. These particular keys were chosen for their location on the keyboard
  294. rather than for their mnemonic value. Notice that the keys to move ahead
  295. are on the home row and that the keys to move backward are immediately
  296. above them in corresponding order. Practice moving the cursor right now,
  297. just to get the feel of these keys.
  298.  
  299.  
  300. COMMAND-LINE COMMANDS
  301.  
  302. Now press the <ESC> key and you should see another cursor appear one
  303. line from the bottom of the screen. This line is called the command
  304. line, and it provides a second set of commands.
  305.  
  306. Perhaps the most useful command for a beginner is the help command. Type
  307. "?<ESC><ESC>", and you will see a summary of all the commands. (Press
  308. <RETURN> two times to get back to the normal text display.)
  309.  
  310. Another way to position the cursor is by using the search command. First
  311. type a CTRL-E to move the cursor to the beginning of the text, then
  312. type:
  313.  
  314.     <ESC>ssecond<ESC><ESC>
  315.  
  316. Your typing should appear on the command line. The "s" indicates a
  317. search command. The word "second" is the word being searched for. The
  318. first <ESC> ends the search, and the second <ESC> executes the command.
  319. The search command can be typed as either "s" or "S", but the case of
  320. the word being searched for should match the case of the word in the
  321. text.
  322.  
  323. The search command is not limited to searching for single words. Several
  324. words, or just about any group of characters, called a string, can be
  325. used.
  326.  
  327. When a search succeeds, the flashing cursor will move to the end of the
  328. matching string. Occasionally, nothing appears to happen because the
  329. search fails. When this occurs, "none?" will be displayed in the lower
  330. left-hand corner. This means that the string being searched for doesn't
  331. exist in the text being searched. Either the cursor was beyond the
  332. matching string, or perhaps because of a typo, the string in the command
  333. didn't match the one in the text.
  334.  
  335. You can also delete characters from the command line. For example, type:
  336.  
  337.     <ESC>6d<ESC><ESC>
  338.  
  339. The six characters preceeding the cursor, the word "second", is deleted.
  340.  
  341. Now type:
  342.  
  343.     <ESC>ithird<ESC><ESC>
  344.  
  345. The word "third" is inserted into the text.
  346.  
  347. The command line can be used to combine commands. For example, press
  348. <ESC> to start the command line, then type:
  349.  
  350.     <CTRL-E>sthird<ESC>5d<ESC>ifourth<ESC><ESC>
  351.  
  352. This series of commands moves the cursor to the beginning of the text,
  353. searches for the word "third", and replaces it with "fourth".
  354.  
  355. You have now learned two methods for searching, deleting, and inserting
  356. characters. The first method used the immediate commands, where control
  357. characters and the back arrow were used. The second method made use of
  358. the command line, using the S, D, and I commands. As your experience
  359. with the editor increases, you will learn to chose between these two
  360. methods. The immediate commands are useful for quick and simple changes,
  361. while the command line can be used to combine commands to perform
  362. elaborate editing tasks.
  363.  
  364.  
  365. EXITING FROM THE EDITOR
  366.  
  367. To exit from the editor type:
  368.  
  369.     <ESC>Q<ESC><ESC>
  370.  
  371. This is the normal method of exiting. It automatically saves your text
  372. in the output file and returns you to Apex. However, if you don't want
  373. to save your text, then use the command:
  374.  
  375.     <ESC>T<ESC><ESC>
  376.  
  377.  
  378.  
  379. DEFAULT FILES
  380.  
  381. Apex has a system of defaults that can be used to significantly reduce
  382. typing. As you write programs, you will be editing, compiling, and
  383. running the same program many times. Using the defaults allows you to
  384. perform these operations without typing the unit number and file name
  385. every time you refer to them.
  386.  
  387. Set the default unit and file name for the program described below by
  388. typing:
  389.  
  390.     APX>DFILE 1:HELLO.XPL<RETURN>
  391.  
  392. Apex replies:
  393.  
  394.     DEFAULT NAME:    1:HELLO   .XPL
  395.     BACKUP:    T    ABORT:  T
  396.     PACK:    F    CHECK:    F
  397.  
  398. Another way Apex saves typing is by allowing you to abbreviate all
  399. commands to just the first two letters.
  400.  
  401. Now type:
  402.  
  403.     APX>MA<SPACE><RETURN>
  404.  
  405. The command MAKE is abbreviated to MA, and the <SPACE> tells Apex that
  406. the command is going to use the default file. Apex says:
  407.  
  408.     CLOSING: 1:HELLO   .XPL 1    TODAY    443-443
  409.  
  410. If you forget the <SPACE>, Apex says: NOPE - NEED FILE NAME. Apex
  411. doesn't know the name of the file because it needs the <SPACE> to tell
  412. it to use the default file name.
  413.  
  414.  
  415. AN XPL0 PROGRAM
  416.  
  417. After you have made the default file above, you are ready to use the
  418. editor to write a program using the XPL0 language. Type:
  419.  
  420.     APX>ED<SPACE><RETURN>
  421.  
  422. Remember the <SPACE>. If you forget it here, Apex will start the editor
  423. with no output file opened, and it will be slightly difficult to save
  424. your text. Once you are in the editor, type in the following program:
  425.  
  426.     code TEXT=12;
  427.     begin
  428.     TEXT(0,"HELLO WORLD!
  429.     ");
  430.     end;
  431.  
  432. The lowercase words have special meaning to XPL0. The word "code" is
  433. used to declare built-in routines called intrinsics. Intrinsic 12
  434. outputs a text string. The name used here, TEXT, is the conventional one
  435. for this intrinsic. Notice that a carriage return is inserted in the
  436. text string by simply placing it within the quotes. The words "begin"
  437. and "end" signify the beginning and ending of a block of statements. In
  438. this case there is only a single statement. The zero in TEXT(0,...)
  439. specifies that the string is to go to Apex device 0, the video screen.
  440. Semicolons (;) are used at the end of declarations and to separate
  441. statements.
  442.  
  443. Save this text and return to Apex by typing:
  444.  
  445.     <ESC>Q<ESC><ESC>
  446.  
  447.  
  448. COMPILING AND EXECUTING AN XPL0 PROGRAM
  449.  
  450. XPL0 is a compiled language. Compiling is the process of translating a
  451. program into a form that is more easily understood by the computer.
  452. BASIC interprets a program step-by-step every time it runs; whereas XPL0
  453. translates a program in a separate step that precedes the actual
  454. execution. This compilation step is the major reason an XPL0 program
  455. typically runs a hundred times faster than a similar BASIC program.
  456.  
  457. To compile your program, type:
  458.  
  459.     APX>XPL<SPACE><RETURN>
  460.  
  461. This starts the XPL0 compiler. Remember, the <SPACE> tells Apex to use
  462. the default file, HELLO.XPL. ("XPL" cannot be abbreviated to "XP"
  463. because it is the name of a program, not an Apex command.) XPL0
  464. replies:
  465.  
  466.     -- XPL0 COMPILER, VER 5.7-68Kx15 --
  467.  
  468.     CHANGE DEFAULTS (N/Y)?
  469.  
  470. The defaults specify the input and output device numbers. For our
  471. example they are fine, so simply type <RETURN> ("No" is assumed).
  472.  
  473. If you made any typos, the compiler will stop, give an error message,
  474. and ask if it should continue. Note the cause of the error and type
  475. <RETURN> to continue ("Yes" is assumed). You might need to hit <RETURN>
  476. several times because some errors get the compiler out of sync with the
  477. code. Edit the file to correct any errors and try again. Once your
  478. program has successfully compiled, execute it by typing:
  479.  
  480.     APX>LOAD<SPACE><RETURN>
  481.  
  482. Again the defaults are fine, so simply type <RETURN> to start loading.
  483. This loads the compiled version of your program, HELLO.OBJ. After the
  484. program is loaded, you will see:
  485.  
  486.     PRESS "RETURN" TO EXECUTE (OR CTRL-P TO SAVE)
  487.  
  488. Press <RETURN> and you should see:
  489.  
  490.     HELLO WORLD!
  491.  
  492. You have written, compiled, and run an XPL0 program. CONGRATULATIONS!
  493.  
  494.  
  495. RUNNING AN ASSEMBLY LANGUAGE PROGRAM
  496.  
  497. If you would like to write the HELLO program in assembly language, set
  498. the default file name, make the file, and start the editor as follows:
  499.  
  500.     APX>DF 1:HELLO.68K<RETURN>
  501.     APX>MA<SPACE><RETURN>
  502.     APX>ED<SPACE><RETURN>
  503.  
  504. Enter the following text using the editor. The separators between the
  505. columns of the program are TABs, not spaces. Be sure to put a <RETURN>
  506. at the end of the END line.
  507.  
  508.     ;HELLO.68K    SEP-20-87
  509.     ;This program displays "HELLO WORLD!" on the video monitor.
  510.  
  511.     CR    EQU    $0D        ;ASCII carriage return code
  512.     DEVICE    EQU    $517        ;Address of DEVICE number variable
  513.     VRENTR    EQU    $7B4        ;Vector to Apex re-entry point
  514.     VDEVHAN    EQU    $7E4        ;Routine to handle device I/O
  515.  
  516.         ORG    $400        ;System page location for start vector
  517.         JMP    START.L        ; (The LOADer jumps to $400)
  518.  
  519.         ORG    $3000        ;Start of free space for user programs
  520.     START    MOVE.B    #0,DEVICE    ;Output to device 0, the video display
  521.         MOVEA.W    #12,A6        ;Set I/O function code to OUTPUT
  522.         MOVEA.L    #HELLO,A0    ;Point A0 to our text string
  523.         BRA.S    HEL20        ;Enter loop
  524.  
  525.     HEL10    JSR    VDEVHAN        ;Output byte in D0 to selected device
  526.     HEL20    MOVE.B    (A0)+,D0    ;Get char from string, bump pointer
  527.         BNE.S    HEL10        ;Loop back if not zero byte
  528.         JMP    VRENTR        ;Re-enter Apex
  529.  
  530.     HELLO    ASCII    "HELLO WORLD!"    ;Text string
  531.         DC.B    CR        ;Carriage return (new line)
  532.         DC.B    0        ;String terminator
  533.  
  534.         END            ;End of program
  535.  
  536. To assemble this program type:
  537.  
  538.     APX>ASM<SPACE><RETURN>
  539.  
  540. The assembler begins by displaying:
  541.  
  542.     -- ASM68K, V1.0x10 --
  543.  
  544.     CHANGE DEFAULTS (N/Y)?
  545.  
  546. The defaults are fine, so simply type <RETURN> to start assembling ("No"
  547. is assumed).
  548.  
  549. The assembler indicates any errors it finds and the total number of
  550. errors detected. Correct any errors using the editor and try again.
  551. When the program assembles without error, load it by typing:
  552.  
  553.     APX>LOAD<SPACE><RETURN>
  554.  
  555. Again the defaults are fine, so simply type <RETURN> to start loading.
  556. To execute the program, type <RETURN> a second time.
  557.  
  558. You should see:
  559.  
  560.     HELLO WORLD!
  561. A MORE ELABORATE XPL0 PROGRAM
  562.  
  563. A program that displays "HELLO WORLD!" is of marginal utility, but with
  564. only slightly more effort you can create a program that lists any Apex
  565. text file on the video screen. Start this new program by typing:
  566.  
  567.     APX>DF 1:PRINT.XPL<RETURN>
  568.  
  569. Make the file in the same manner as you did for the program HELLO.XPL
  570. then enter the editor and type in the following:
  571.  
  572.     \PRINT.XPL    SEP-20-87
  573.     \THIS PROGRAM PRINTS TEXT FILES.
  574.     code CHIN=7, CHOUT=8, OPENI=13, OPENO=14, CLOSE=15;
  575.     integer CH;
  576.     define IN=3, OUT=0;
  577.     define EOF=$1A;        \CTRL-Z
  578.     begin
  579.     OPENI(IN);
  580.     OPENO(OUT);
  581.     CH:= CHIN(IN);
  582.     while CH#EOF do
  583.         begin
  584.         CHOUT(OUT,CH);
  585.         CH:= CHIN(IN);
  586.         end;
  587.     CLOSE(OUT);
  588.     end;
  589.  
  590. This program has a number of new XPL0 features. First is the "\". The
  591. backslash is the XPL0 designator for a comment.
  592.  
  593. The intrinsic CHIN (code 7) gets a character from an input device. The
  594. opposite of CHIN is CHOUT, which outputs a character to an output
  595. device. The intrinsics OPENI and OPENO open (initialize) devices for
  596. input and output respectively, while the intrinsic CLOSE closes an
  597. output device. Devices don't always need to be opened and closed, but
  598. until you become more familiar with XPL0, it's a good idea to use these
  599. intrinsics.
  600.  
  601. The variable CH is declared as an integer in the forth line. Unlike
  602. BASIC or FORTRAN, XPL0 requires that variables, as well as all named
  603. things, be declared before they are used.
  604.  
  605. Next are the define declarations. These are used to give names to
  606. constants. A defined constant can be used just like a variable, except
  607. that its value cannot be changed as the program executes. The constant
  608. EOF is set to a hexadecimal value of 1A. The value $1A is equivalent to
  609. a CTRL-Z, which is used by Apex as an end-of-file mark. 
  610.  
  611. The symbol "#" is used to represent "not equal". The main body of the
  612. program reads, translated into English: While X is not equal to the end-
  613. of-file mark, output the character to device 0, the video screen, and
  614. input another character from device 3, a disk file.
  615.  
  616. After you have entered and compiled this program, make it a .SAV file so
  617. that it will be easy to run. Load the program using LOAD, then when the
  618. message:
  619.  
  620.     PRESS "RETURN" TO EXECUTE (OR CTRL-P TO SAVE)
  621.  
  622. appears, type a CTRL-P. When the Apex prompt appears, type:
  623.  
  624.     APX>SAVE<SPACE><RETURN>
  625.  
  626. This creates a .SAV file, which is a copy of the executable form of your
  627. program. Run this program by typing its unit number and name followed by
  628. the name of the file you want to print. For example, this prints the
  629. program that you just created:
  630.  
  631.     APX>1:PRINT PRINT.XPL<RETURN>
  632.  
  633.  
  634.  
  635. TYPES OF APEX FILES
  636.  
  637. List the directory and notice the files PRINT.XPL, PRINT.OBJ, and
  638. PRINT.SAV. PRINT.XPL is the source file that you created using the
  639. editor. PRINT.OBJ is the XPL0 compiler output file. Type:
  640.  
  641.     APX>1:PRINT PRINT.OBJ<RETURN>
  642.  
  643. You should see something like this:
  644.  
  645.     ;000048E77F80204D4BED000472032A814EB8084E42954EB8085472032A814EB8
  646.     082A20802210741AB2826700FFD67200241048D500064EB8083072032A814EB8
  647.     082A208060DE^002A42954EB8085A2A484CDF01FE4E75
  648.  
  649. This listing is in hexadecimal ASCII and is decipherable with effort,
  650. but is certainly less understandable by humans than the original source.
  651. The two files, PRINT.XPL and PRINT.OBJ, consist entirely of ASCII
  652. characters that can be displayed on the video screen.
  653.  
  654. Listing the PRINT.SAV file gives a bizarre combination of characters and
  655. graphics. This file is a binary memory image of your executable program,
  656. and it is not meant to be listed.
  657.  
  658.  
  659. INSTALLING A PRINTER HANDLER
  660.  
  661. You might want to modify your PRINT.XPL program so that it will output
  662. to the printer instead of the video screen. All you have to do is change
  663. the fifth line from OUT=0 to OUT=2. However, this program already
  664. exists. It's the utility called PR.
  665.  
  666. Now use PR (or your modified PRINT program) to test your printer by
  667. typing:
  668.  
  669.     APX>PR PRINT.XPL<RETURN>
  670.  
  671. Your program, PRINT.XPL, should be listed on the printer. If it didn't
  672. list or if you got a bunch of garbage, then you need to install a
  673. different printer handler. Even if you do get a correct listing, you
  674. might want to install either the Epson or C.Itoh handler. These handlers
  675. use elite characters and print 96 columns instead of the standard
  676. handlers, which use pica characters and only print 80 columns.
  677.  
  678. A printer handler is a routine that handles the details of communi-
  679. cating between Apex and a printer. It relieves the programmer from
  680. worrying about what type of printer is actually being used, and it
  681. provides a uniform way of handling characters and commands. It also
  682. provides additional intelligence, which for example, is used to put
  683. margins at the top and bottom of each page.
  684.  
  685. There are many manufacturers of printers. Luckily, they tend to
  686. standardize on just a few different types. Epson-type printers include
  687. Epson, Comrex, and Star Gemini. C.Itoh-type printers include C.Itoh,
  688. Prowriter, and NEC.
  689.  
  690.     PRINTER        HANDLER
  691.  
  692.     Epson        EPSONHAN.OBJ    96 columns (elite)
  693.     C.Itoh        ITOHAN.OBJ    96 columns (elite)
  694.     others        PARHAN.OBJ    80 columns (pica)
  695.             DUMHAN.OBJ    80 columns, no intelligence
  696.  
  697. To install, for example, the C.Itoh handler, type:
  698.  
  699.     APX>INSTALL 0:ITOHAN<RETURN>
  700.  
  701. Answer the questions as follows:
  702.  
  703.     WHICH UNIT: 0<RETURN>
  704.     LOADING...
  705.     MODIFYING 0:RESCOD.SYS - ARE YOU SURE (N/Y)? Y<RETURN>
  706.  
  707. The new handler is now installed on your Apex System disk, but it is not
  708. loaded into memory ready for use. To load the new handler, you must re-
  709. boot. Test this handler by rebooting and printing PRINT.XPL as you did
  710. above.
  711.  
  712. BACKUP FILES
  713.  
  714. Apex automatically saves backup copies of your files. This allows you to
  715. recover the previous version of a file. Type:
  716.  
  717.     APX>LIST PRINT.BAK<RETURN>
  718.  
  719. You should see the previous version of your program, PRINT.XPL.
  720.  
  721. If you attempt to edit this backup file by typing:
  722.  
  723.     APX>ED PRINT.BAK<RETURN>
  724.  
  725. you will get an error message because Apex will not allow you create an
  726. output file with the extension ".BAK". You can explicitly indicate an
  727. output file with a valid extension by doing this:
  728.  
  729.     APX>ED PRINT.XPL<PRINT.BAK<RETURN>
  730.  
  731. Although it's a good idea to have Apex save backup copies of your files,
  732. you might not always want it to. For example, if your disk is getting
  733. too full. You can turn off backups with the command:
  734.  
  735.     APX>NO BACKUP<RETURN>
  736.  
  737. To turn backups on again, type:
  738.  
  739.     APX>DO BACKUP<RETURN>
  740.  
  741. To see the current state of the backup option, use the DFILE command.
  742.  
  743.  
  744. SQUASH
  745.  
  746. Apex writes files in contiguous sectors. This makes disk accesses faster
  747. than they are with Amiga DOS, which uses linked sectors. However, with
  748. Apex, as you use the disk, the free space tends to become chopped up
  749. into little pieces. This free space might become so fragmented that a
  750. file will not fit even though there is plenty of free space on the disk.
  751. Now type:
  752.  
  753.     APX>DI 1<RETURN>
  754.  
  755. Notice the last line. FREE tells you the total number of unused blocks
  756. on the unit. MAX tells you the largest file you can save on the unit.
  757. Observe that MAX is less than FREE. The squash command, SQ, moves all
  758. the files to the beginning of the disk leaving all the free space at the
  759. end. Type:
  760.  
  761.     APX>SQ 1<RETURN>
  762.  
  763. Now look at the directory and notice that FREE and MAX are the same.
  764. DELETE
  765.  
  766. To remove files from the directory, use the DELETE command. For
  767. example:
  768.  
  769.     APX>DE AFILE.TXT<RETURN>
  770.  
  771. Apex replies:
  772.  
  773.     REMOVING 1:AFILE   .TXT  1    TODAY    443-443
  774.      - ARE YOU SURE (N/Y)?
  775.  
  776. Type: Y<RETURN> to actually delete this file.
  777.  
  778. In Apex an asterisk (*) is used as a wild-card substitution. For
  779. example:
  780.  
  781.     APX>DE *.BAK<RETURN>
  782.  
  783. deletes all of the files with the extension ".BAK".
  784.  
  785.  
  786. COPY
  787.  
  788. Whereas DUP was used to duplicate an entire disk, COPY is used to copy
  789. individual files. For example, copy the file XPLCODES.XPL from unit 0 to
  790. unit 1 as follows:
  791.  
  792.     APX>COPY<RETURN>
  793.     FILE? XPLCODES.XPL<RETURN>
  794.     FROM, TO UNITS? 0,1<RETURN>
  795.  
  796. After the file is copied, COPY will prompt you for another file name.
  797. When you want to return to Apex, just press <RETURN> without a file
  798. name.
  799.  
  800.  
  801. HELP
  802.  
  803. The HELP utility provides a summary of all the Apex commands and of some
  804. of the more common utilities. If you have not yet tried it, type:
  805.  
  806.     APX>HELP<RETURN>
  807.  
  808. Good luck!
  809. ex commands and of s